/**
 * @Author: 陈瑞鹏
 * @Date:   2022-11-01 17:23:27
 * @Last Modified by:   陈瑞鹏
 * @Last Modified time: 2023-09-18 11:40:09
 */
import mongoose from 'mongoose';

const Schema = mongoose.Schema;
const GUserSchema: mongoose.Schema = new Schema({
  openId: { type: String, display: '用户ID', index: true },
  roleId: { type: Number, display: '角色ID', index: true },
  nickName: { type: String, display: '角色昵称', index: true },
  worldId: { type: String, display: "世界id", default: 1, index: true },
  avatar: { type: String, display: '头像' },
  diamonds: { type: Number, display: '钻石' },
  lockArr: { type: Array, display: '解锁数组' },
  ranksArr: { type: Array, display: '队列数组' },
  integral: { type: Number, display: '段位积分', default: 0 },
  score: { type: Number, display: "冒险积分", default: 0 },

  wIntegral: { type: Number, display: '周段位积分', default: 0 },
  wScore: { type: Number, display: "周冒险积分", default: 0 },
  sWeek: { type: Number, display: "冒险积分第几周", default: 0 },
  iWeek: { type: Number, display: "段位积分第几周", default: 0 },

  victoryNum: { type: Number, display: "累胜", default: 0 },
  guideId: { type: Number, display: "引导id", default: 1 },
  regIp: { type: String, display: '注册ip' },
  loginIp: { type: String, display: '登录IP' },
  status: { type: Boolean, display: '账号状态', default: true },
  statusDesc: { type: String, display: '账号状态描述', },
  updateTime: { type: String, display: '更新时间' },
  createTime: { type: String, display: '创建时间' },
}).index({ openId: 1 }).index({ status: 1, updateTime: 1 }).index({ roleId: 1, sid: 1 });

const GUser = mongoose.model('GUser', GUserSchema);
export default GUser;